var allhref = 'all.html';
var evalhref = 'eval.html';
var interhref = 'inter.html';
var alinterhref = 'alinter.html';
var employhref = 'employ.html';
var entryhref = 'entry.html';
var quithref = 'quit.html';
var singlehref = 'single.html';
var search = '';

$.post(
	allhref,
	{'type':0,'_csrf':$('.request-csrf').val()},
	function(res){
		$('.Recommend-tab-table').html(res);
	}
	)

$('.lis').on('click',function(){
	var href = $(this).attr('data-href');
	$.post(
        href,
        {'search':search,'_csrf':$('.request-csrf').val()},
        function (res) {
            $('.Recommend-tab-table').html(res);
        }
    );
});

$('.searchbtn').on('click',function(){
	var tx = $('.mr5').val();
	if(!(tx == null || tx == undefined))
	{
		search = tx;
		$('.mrtt').val(search);
		$('.lis').each(function(i){
			var type = $(this).data('type');

			switch(type)
			{
				case -1:$(this).attr('data-href',allhref);break;
				case 0:$(this).attr('data-href',evalhref);break;
				case 1:$(this).attr('data-href',interhref);break;
				case 2:$(this).attr('data-href',alinterhref);break;
				case 3:$(this).attr('data-href',employhref);break;
				case 4:$(this).attr('data-href',entryhref);break;
				case 5:$(this).attr('data-href',quithref);break;
				case 6:$(this).attr('data-href',singlehref);break;
			}

			var href = $('.borh4blue').attr('data-href');

			$.post(
		        href,
		        {'search':search,'_csrf':$('.request-csrf').val()},
		        function (res) {
		            $('.Recommend-tab-table').html(res);
		        }
		    );

		})


	}
});



